1. Technical Field
The present invention relates to computer code transformation and more particularly, to computer code transformation that supports extraction of statements that are not on the same loop.
2. Discussion Of The Related Art
As the amount of legacy computer code accumulates, hundreds of thousands of code lines are imposing a real challenge for programmers both in code readability and code reuse terms. In order to use portions of legacy code, it becomes crucial for programmers to be able to separate these portions of code lines (or statements) that are associated with a single operation so that the extracted statements may be either reused or replaced in their entirety by a newer version.
One known solution for separating code statements from an original code is called the Extract Method refactoring. This method can be useful by itself, or as a building block in larger refactoring tasks. Because it requires a deep analysis of data and control dependences, it is difficult to perform correctly without tools in complicated cases. Unfortunately, refactoring tools do not perform the required analysis, and will fail in or reject such cases. Some very useful cases, such as those involving non-contiguous code, cannot even be expressed using these tools' interfaces.